<template>
  <div id="home-grid">
    <van-grid :border='false'>
      <van-grid-item v-for="(item,index) in catitems" :key="index" >
        <img :src="item.image_src">
      </van-grid-item>
    </van-grid>
  </div>
</template>

<script>
import Vue from 'vue';
import { Grid, GridItem } from 'vant';
import "vant/lib/grid/style"
import 'vant/lib/grid-item/style'
Vue.use(Grid);
Vue.use(GridItem);

export default {
  name:"HomeGrid",
  created() {
    this.$http({
      url:"/api/public/v1/home/catitems",
      methods:"get"
    }).then(res => {
      this.catitems = res.data.message
    })
  },
  data() {
    return {
      catitems:[]
    }
  },
}
</script>

<style scoped>
  #home-grid img{
    width: 80%;
  }
</style>